package edu.cornell.cs4740.qa.baseline;

import edu.stanford.nlp.stats.EquivalenceClasser;

public class Answer implements Comparable{
	String questionNumber;
	String documentId;
	private String answerText;
	
	public Answer(String questionNumber, String documentId, String answerText) {
		this.questionNumber = questionNumber;
		this.documentId = documentId;
		this.answerText = answerText;
	}
	
	public String getAnswerText(){
		return answerText;
	}
	
	public String getQuestionNumber() {
	  return questionNumber;
	}

	@Override
	public String toString() {
		return questionNumber + " " + documentId + " " + answerText;
	}

	@Override
	public int compareTo(Object arg0) {
		Answer a = (Answer)arg0;
		return answerText.compareTo(a.getAnswerText());
	}
	
	public boolean equals(Object arg0){
		Answer a = (Answer) arg0;
		return this.equals(a);
	}
	
	public boolean equals(Answer a){
		return answerText.equalsIgnoreCase(a.getAnswerText());
	}
	
	public int hashCode(){
		return answerText.hashCode();
	}
}
